package behavior.iterator;

import java.util.List;
public class ComputerCollegeIterator implements Iterator {
    List<Department> departmentList;
    int position = -1;

    public ComputerCollegeIterator(List<Department> departmentList) {
        this.departmentList = departmentList;
    }

    @Override
    public boolean hasNext() {
        return position < departmentList.size() - 1;
    }

    @Override
    public Object next() {
        position += 1;
        return departmentList.get(position);
    }

}
